package cn.tedu.ivos2.geofence.controller;

import cn.tedu.ivos2.base.response.JsonResult;
import cn.tedu.ivos2.geofence.pojo.dto.GeofenceQuery;
import cn.tedu.ivos2.geofence.pojo.vo.GeofenceVO;
import cn.tedu.ivos2.geofence.service.GeofenceService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 边拾柱
 * @date 2025/1/5 10:27
 */
@Slf4j
@RestController
@RequestMapping("/v1/geofence")
@Api(tags = "4. 电子围栏模块")
public class GeofenceController {

    @Autowired
    private GeofenceService geofenceService;

    @GetMapping("select")
    @ApiOperation("查询围栏")
    @ApiOperationSupport(order = 10)
    public JsonResult selectGeofence(GeofenceQuery geofenceQuery) {
        log.debug("开始处理查询电子围栏请求,查询条件为:{}",geofenceQuery);
        List<GeofenceVO> list = geofenceService.selectGeofence(geofenceQuery);
        return JsonResult.ok(list);
    }
}
